﻿function _InitScroll(_S1, _S2, _W, _H, _T) {
    return "var marqueesHeight" + _S1 + "=" +
        _H + ";var stopscroll" + _S1 +
        "=false;var scrollElem" + _S1 +
        "=document.getElementById('" + _S1 + "');with(scrollElem" + _S1 +
        "){style.width=" + _W + ";style.height=marqueesHeight" + _S1 +
        ";style.overflow='hidden';noWrap=true;}scrollElem" + _S1 +
        ".onmouseover=new Function('stopscroll" + _S1 + "=true');scrollElem" + _S1 +
        ".onmouseout=new Function('stopscroll" + _S1 + "=false');var preTop" + _S1 +
        "=0; var currentTop" + _S1 + "=0; var stoptime" + _S1 + "=0;var leftElem" + _S2 +
        "=document.getElementById('" + _S2 + "');scrollElem" + _S1 +
        ".appendChild(leftElem" + _S2 + ".cloneNode(true));setTimeout('init_srolltext" + _S1 +
        "()'," + _T + ");function init_srolltext" + _S1 + "(){scrollElem" + _S1 +
        ".scrollTop=0;setInterval('scrollUp" + _S1 + "()',50);}function scrollUp" + _S1 +
        "(){if(stopscroll" + _S1 + "){return;}currentTop" + _S1 + "+=1;if(currentTop" + _S1 +
        "==(marqueesHeight" + _S1 + "+1)) {stoptime" + _S1 + "+=1;currentTop" + _S1 +
        "-=1;if(stoptime" + _S1 + "==" + _T / 50 + ") {currentTop" + _S1 +
        "=0;stoptime" + _S1 + "=0;}}else{preTop" + _S1 + "=scrollElem" + _S1 +
        ".scrollTop;scrollElem" + _S1 + ".scrollTop +=1;if(preTop" + _S1 +
        "==scrollElem" + _S1 + ".scrollTop){scrollElem" + _S1 +
        ".scrollTop=0;scrollElem" + _S1 + ".scrollTop +=1;}}}";
}


//var a1 = document.getElementById("A1");
//var a2 = document.getElementById("A2");
//if (a1&&a2)
//    go();

//function go() {

//}
//eval(_InitScroll("C1", "shuli", 420, 19 * 6, 100));

/*
A1,A2或B1,B2是滚动内容区域外的两个DIV的ID
如
    <div id="B1">
        <div id="B2">
_W为滚动内容的宽度
_H为滚动内容的高度,必须为单元格高度的整数倍，这里每个单元格是19px高
_T为滚动后每次停留言时间
*/
//-->
